﻿using MySql.Data.MySqlClient;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace DataAccessService.Repository.MySQL
{
    public class MySQLConnectRepository
    {
        public MySql.Data.MySqlClient.MySqlConnection GetConn(string connStr)
        {
            try
            {
                //创建数据库连接
                MySqlConnection mySqlConnection = new MySqlConnection(connStr);

                mySqlConnection.Open();
                return mySqlConnection;
            }
            catch (Exception)
            {
                return null;
            }                     
        }
    }
}
